﻿
using HBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace hconnect {
    //b到A单向行走
    public abstract class OneWayExchangeTask :ExchangeBaseTask {
        public abstract ExchangeStatus fromStatus();
        public abstract ExchangeStatus toStatus();
        public abstract void fromStopOut();
        public abstract void toDoIn();
        public abstract void fromDoOut();
        public sealed override void bDoIn() {
        }
        public sealed override void aDoOut() {
        }
        public sealed override void aFinishOut() {
        }
        public sealed override void aDoIn() {
            toDoIn();
        }
        public sealed override void bDoOut() {
            fromDoOut();
        }
        public sealed override void bFinishOut() {
            fromStopOut();
        }
        public sealed override ExchangeStatus getA() {
            ExchangeStatus esA = toStatus();
            if( esA == ExchangeStatus.OutIng || esA == ExchangeStatus.OutReady ) {
                console(InfoCode.consle_exchange_runed, "接收位置状态异常 ");
                return ExchangeStatus.unNone;
            }
            return esA;
        }
        public sealed override ExchangeStatus getB() {
            ExchangeStatus esB = fromStatus();
            if( esB == ExchangeStatus.Ined || esB == ExchangeStatus.InIng ) {
                console(InfoCode.consle_exchange_runed, "起始位置状态异常 ");
                return ExchangeStatus.unNone;
            }
            return esB;
        }
    }
}
